aboutsummaryrefslogtreecommitdiff
path: root/frontend/src/routes/status/[id]/+page.ts
diff options
context:
space:
mode:
Diffstat (limited to 'frontend/src/routes/status/[id]/+page.ts')
-rw-r--r--frontend/src/routes/status/[id]/+page.ts3
1 files changed, 2 insertions, 1 deletions
diff --git a/frontend/src/routes/status/[id]/+page.ts b/frontend/src/routes/status/[id]/+page.ts
index 4351aae..1b91c67 100644
--- a/frontend/src/routes/status/[id]/+page.ts
+++ b/frontend/src/routes/status/[id]/+page.ts
@@ -11,7 +11,8 @@ export const load: PageLoad = async ({ params, fetch }) => {
const services = servicesRes?.ok ? await servicesRes.json() : [];
const svc = services.find((s: any) => s.id === Number(id));
- const history = historyRes?.ok ? await historyRes.json() : [];
+ const historyJson = historyRes?.ok ? await historyRes.json() : [];
+ const history = Array.isArray(historyJson) ? historyJson : (historyJson.data ?? []);
const stats = statsRes?.ok ? await statsRes.json() : null;
return {